//
//  ExampleDetailCell.m
//  NekaPrice
//
//  Created by yu on 2018/6/28.
//  Copyright © 2018年 ma c. All rights reserved.
//

#import "ExampleDetailCell.h"

@implementation ExampleDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    _imgView = [[UIImageView alloc] init];
    [self addSubview:_imgView];
}

- (void)setImageURL:(NSString *)url {
    
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"yangbanjing"]];
    
}

- (UIImageView *)imgView {
    if (_imgView == nil) {
        _imgView = [[UIImageView alloc] init];
        [self addSubview:_imgView];
        [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.mas_equalTo(0);
            make.bottom.mas_equalTo(-5);
        }];
        _imgView.userInteractionEnabled = YES;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showImage)];
        [_imgView addGestureRecognizer:tap];
    }
    return _imgView;
}

- (void)showImage {
    if (_tapBlock) {
        _tapBlock(self.imgView);
    }
}




@end
